This page last changed on Nov 22, 2005 by cholmes.

The first step for adding a new language to GeoServer is to create the file ApplicationResources_your language.properties under WEB-INF directory.

Then, you need to translate every string associated with a keyword in your properties file :
ApplicationResources.properties (the reference file) :
...
label.name=Name
...
ApplicationResources_fr.properties (my favorite targetted language) :
...
label.name=Nom
...

I am using the following procedure to maintain the translation up (being under Linux, the following uses Linux command lines) :

1. Save the reference properties file somewhere in your computer (preferably not under the GeoServer source tree) :

$ cp $\{GEOSERVER_HOME\}/WEB-INF/ApplicationResources.properties $\{HOME\}/geoserver/

2. Download the svn version http://svn.refractions.net/geoserver/trunk/geoserver :

$ svn checkout http://svn.refractions.net/geoserver/trunk/geoserver $\{GEOSERVER_HOME\}

3. make a diff between the new and the old reference files :

$ diff $\{GEOSERVER_HOME\}/WEB-INF/ApplicationResources.properties  $\{HOME\}/geoserver/ApplicationResources.properties

4. update your ApplicationResources_your language.properties file accordingly

5. check your translation with a browser (specially usefull when using HTML entities). I have made the following scripts :

build_gsl_html.sh:

#!/bin/bash

GSL=$1
TARGET_HTML="$\{HOME\}/geoserver/$\{GSL\}.html"
cat $\{HOME\}/geoserver/gsl_head_html > $\{TARGET_HTML\}
awk 'BEGIN\{\}\{printf "%s<br>",$0;\}' \
    $\{GEOSERVER_HOME\}/WEB-INF/ApplicationResources_$\{GSL\}.properties >> $\{TARGET_HTML\}
cat $\{HOME\}/gsl_tail_html >> $\{TARGET_HTML\}
exit 0

gsl_head_html :

<html>
<head>
<title>"your language"</title>
</head>
<body>

gsl_tail.html :

</body>
</html>

execute build_gsl_html.sh, and point your browser to ${HOME}/geoserver/your language.html file.

6. correct errors if any

7. save the reference file :

$ cp $\{GEOSERVER_HOME\}/WEB-INF/ApplicationResources.properties $\{HOME\}/geoserver/

That's it !

You are ready to contribute to GeoServer's internationalisation process.

Document generated by Confluence on Jan 16, 2008 23:26